import { post } from "../utils/request";

var app = getApp();
//买断
export const buy = (params) => {
  return post(app.globalData.apiUrl + 'order/buy', params);
};

//取消订单
export const cancelOrder = (params) => {
  return post(app.globalData.apiUrl + 'order/cancelOrder', params);
};

//确认收货
export const confirmDelivery = (params) => {
  return post(app.globalData.apiUrl + 'order/confirmDelivery', params);
};

// 提交订单，获取待确认订单列表
export const confirmOrder = (params) => {
  return post(app.globalData.apiUrl + 'order/confirmOrder', params);
};

//确认归还

export const confirmReturn = (params) => {
  return post(app.globalData.apiUrl + 'order/confirmReturn', params);
};

// 获取最迟发货时间
export const getLateDeliveryTime = (params) => {
  return post(app.globalData.apiUrl + 'order/getLateDeliveryTime', params);
};

// 获取订单详情
export const getOrderDetail = (params) => {
  return post(app.globalData.apiUrl + 'order/getOrderDetail', params);
};
// 获取个人订单列表
export const getOrderList = (params) => {
  return post(app.globalData.apiUrl + 'order/getOrderList', params);
};
// 查看结算单
export const getSettle = (params) => {
  return post(app.globalData.apiUrl + 'order/getSettle', params);
};
 // 支付
export const payOrder = (params) => {
  return post(app.globalData.apiUrl + 'order/payOrder', params);
};
//续租 
export const renewal = (params) => {
  return post(app.globalData.apiUrl + 'order/renewal', params);
};

//提交订单，生成待支付订单 
export const submitOrder = (params) => {
  return post(app.globalData.apiUrl + 'order/submitOrder', params);
};

